The present invention is directed to a circuit for measuring movement of an object and, more particularly, to a counter based circuit for measuring movement of an object, even at slow speeds.
Electronic measurement of movement typically uses an encoder to acquire data concerning the position and speed of a moving object. The movement may be rotary or linear. For example, the moving object may be a driven part of a motor whose speed and/or position may be controlled as a function of the data acquired from the encoder.
An incremental encoder typically provides pulse signals at incremental displacements of the moving object. A quadrature encoder has two output pulse signals (A and B) spaced apart by a quarter cycle, in order to enable the sense of movement (positive or negative) to be distinguished.
At high speeds, the number of encoder pulses occurring in a measurement interval may be counted (‘M’ method), while at low speeds, the number of clock pulses occurring between successive encoder pulses may be counted (‘T’) method, and it is possible to combine the techniques (‘M/T’ method). However, if the interval between successive encoder pulses is longer than the periodicity of processing the movement data, such as a speed control period, the result of the measurement may be erroneous due to the detection dead time. Increasing the processing period reduces the minimum speed that can be measured accurately but the performance of processing, especially of speed or position control, will deteriorate. Increasing the density of encoder pulses by increasing the number of encoder lines, for example, increases the cost of the encoder.
A conventional speed measurement method triggers a capture interrupt to process the movement data from the encoder and calculate the speed. A conventional control method triggers a control interrupt to perform the control algorithm based on the calculated speed. The capture and control interrupts are independent. If the control interrupt has priority, the control algorithm risks using out-of-date movement data, whereas if the capture interrupt has priority, the control algorithm risks exceeding the maximum time allowed, disturbing the movement control.
It would be advantageous to have a technique for improving the precision of measuring movement, even at slow speeds, without increasing the cost of an encoder and without introducing interrupts additional to the control interrupts in the processing of the data.